<?php
include_once('libs/class.database.php');

class TentangKami
{
	public $link;
	
	function __construct()
	{
		$konek= new Database();
		$this->link=$konek->connect();
	}
	
	function tambahTentangkami($developer, $telp, $email,$fax, $lokasi, $ket, $gb_kami)
	{
		
		$query=$this->link->prepare("INSERT INTO tentangkami (developer, telp, email, fax, lokasi_kantor, ket, gb_kami) 
			 VALUES(?,?,?,?,?,?,?)");
		$data=array($developer, $telp, $email,$fax, $lokasi, $ket, $gb_kami);
		$query->execute($data);
		$jml_row=$query->rowCount();
		return $jml_row;
	}
	
	 function getAllTentangKami()
	{
		$query=$this->link->query("SELECT * FROM tentangkami");
		$jml_data=$query->rowCount();
		if($jml_data>=1)
		{
			$hasil=$query->fetchAll();
			return $hasil;
		}
		else
		{
			return $jml_data;
		}
	}
	
	 
	 
	function updateTentangkami($developer, $telp, $email,$fax, $lokasi, $ket, $gb_kami)
	{
	
		$query=$this->link->query("UPDATE tentangkami SET developer='$developer', telp='$telp' ,email='$email',fax='$fax',lokasi_kantor='$lokasi', ket='$ket', gb_kami='$gb_kami'      WHERE kd_tentangkami='$kd_tentangkami'");
		$hasil=$query->rowCount();
		return $hasil;
	}
	
	function deleteTentangkami($kd_tentangkami)
	{
		$query=$this->link->query("Delete tentangkami WHERE kd_tentangkami='$kd_tentangkami'");
		$hasil=$query->rowCount();
		return $hasil;
	}
}
?>